<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-type" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group condition {if in_array($row['type'],[2,3])}hide{/if}">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <input type="hidden" value="{$row.content|htmlentities}" data-condition="{$row.type}" id="edit-condition-data">
        <div class="col-xs-12 col-sm-8" id="condition-data">
            {if $row['type']==1}
            <input id="c-content" class="form-control selectpage" data-multiple="true"
                data-source="shop/goods/index" data-field="title" name="row[content]" type="text" value="{$row.content|htmlentities}">
            {elseif $row['type']==4}
                <input id="c-content" class="form-control selectpage" data-multiple="true"
                data-format-item="{spacer} {name}" data-source="shop/category/index/noKeyField/100" name="row[content]" type="text" value="{$row.content|htmlentities}">
            {elseif $row['type']==5}
                <input id="c-content" class="form-control selectpage" data-multiple="true"
                    data-source="shop/brand/index" data-field="name" name="row[content]" type="text" value="{$row.content|htmlentities}">
            {elseif $row['type']==6}
                    <input id="c-content" class="form-control selectpage" data-multiple="true"
                        data-source="vip/vip/index" data-field="name" name="row[content]" type="text" value="{$row.content|htmlentities}">
            {else/}
            <input id="c-content" class="form-control" name="row[content]" type="text"
                value="{$row.content|htmlentities}">
            {/if}
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
{include file="shop/coupon_condition/selecttpl" /}
